#include <bits/stdc++.h>

using namespace std;
const int L=1001;
int pos[L],step[L];
int main_58_1()
{
    int n,l,t;
    scanf("%d%d%d",&n,&l,&t);
    for (int i=0;i<n ;++i )
    {
        scanf("%d",&pos[i]);
        step[i]=1;
        if (pos[i]==l||pos[i]==0)
        {
            step[i]=-step[i];
        }
    }
    for (int j=0;j<t ;++j )
    {
        for (int i=0;i<n ;++i )
        {
            pos[i]+=step[i];
            if (pos[i]==l||pos[i]==0)
            {
                step[i]=-step[i];
            }
        }
        for (int i=0;i<n ;++i )
        {
            for (int k=i+1;k<n ;++k )
            {
                if (pos[i]==pos[k])
                {
                    step[i]=-step[i],step[k]=-step[k];
                }
            }
        }
    }
    for (int i=0;i<n ;++i )
    {
        printf("%d ",pos[i]);
    }
    return 0;
}
